<!DOCTYPE HTML>
<html>

<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/h-ui/css/H-ui.min.css" />
	<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/H-ui.admin.css" />
	<link rel="stylesheet" type="text/css" href="../lib/Hui-iconfont/1.0.8/iconfont.css" />
	<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/skin/default/skin.css" id="skin" />
	<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/style.css" />
	<link rel="stylesheet" type="text/css" href="../lib/jqueryPage/paging.css" />
	<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
	<title>子商户列表</title>
	<script type="text/javascript" src="../lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="../lib/layer/2.4/layer.js"></script>
	<script type="text/javascript" src="../static/h-ui/js/H-ui.min.js"></script>
	<script type="text/javascript" src="../static/h-ui.admin/js/H-ui.admin.js"></script>
	<!-- 分页器 -->
	<link rel="stylesheet" href="../lib/page/page.css">
	<script src="../lib/page/paging.js"></script>
	<!--/_footer 作为公共模版分离出去-->

	<!--请在下方写此页面业务相关的脚本-->
	<script type="text/javascript" src="../lib/My97DatePicker/4.8/WdatePicker.js"></script>
	<script type="text/javascript" src="../lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<!-- <script type="text/javascript" src="../lib/jqueryPage/paging.min.js"></script> -->
	<script type="text/javascript" src="../lib/laypage/1.2/laypage.js"></script>
	<script src="../lib/jrender.min.js" type="text/javascript"></script>
	<script src="../lib/datatables/1.10.0/jquery.dataTables.min.js"></script>



	<script src="../js/config.js"></script>

	<script type="text/javascript">
		$.views.converters("timeFilter", function (val) {
			var fmt = "yyyy-MM-dd hh:mm:ss";
			var data = new Date(val);

			var o = {
				"M+": data.getMonth() + 1, //月份 
				"d+": data.getDate(), //日 
				"h+": data.getHours(), //小时 
				"m+": data.getMinutes(), //分 
				"s+": data.getSeconds(), //秒 
				"q+": Math.floor((data.getMonth() + 3) / 3), //季度 
				"S": data.getMilliseconds() //毫秒 
			};

			if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (data.getFullYear() + "").substr(4 - RegExp.$1.length));
			for (var k in o)
				if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" +
					o[k]).substr(("" + o[k]).length)));

			return fmt;
		});


		$(function () {
			var account = $.cookie('user__userName');
			var md5 = $.cookie('user__code');
			var userMerchantNo = $.cookie('user_mcno');
			var search_obj={};

			ajaxPage(1);
			function ajaxPage(num) {
				$.ajax({
					type: 'POST',
					url: $.webConfig.basicUrl + '/chuyangPay/user/getUserList',
					data: {
						account: account,
						md5: md5,
						userMerchantNo: userMerchantNo,
						pageSize: num?num:1,
						type: search_obj['type'] ? search_obj['type'] : 0,
						rows:10,
						userOrderNo: search_obj['userOrderNo'] ? search_obj['userOrderNo'] : null,
						start_time: search_obj['start_time'] ? search_obj['start_time'] : null,
						end_time: search_obj['end_time'] ? search_obj['end_time'] : null
					},
					dataType: "json",
					success: function (data) {
						if (data['code'] == 200) {
							jsRenderTpl = $.templates('#j-specCard');
							finalTpl = jsRenderTpl(data);
							$('.j-specCard-box').html(finalTpl);
							//分页
							$("#page").paging({
								pageNo: num,
								totalPage: Math.ceil(data.return_count / 18)?Math.ceil(data.return_count / 18):66,
								totalSize: data.return_count?data.return_count:66,
								callback: function (num) {
									ajaxPage(num)
								}
							})

						} else {
							layer.alert(data['msc']);
						}
					},
					error: function (err) {
						console.log(err);
					}
				})
			}

			$("#searchmes").click(function () {
				// var type = $("#type").val();
				var orderType = $("#orderType").val();
				var orderNo = $("#orderNo").val();
				var userOrderNo = $("#userOrderNo").val();
				var start_time = $('#start_time').val();
				var end_time = $('#end_time').val();


				// search_obj['type'] = type;
				search_obj['orderType'] = orderType;
				search_obj['orderNo'] = orderNo;
				search_obj['userOrderNo'] = userOrderNo;
				search_obj['start_time'] = start_time;
				search_obj['end_time'] = end_time;

				ajaxPage(1);

			})
		})
	</script>
</head>

<body>
	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i> 首页
		<span class="c-gray en">&gt;</span> 调用查询
		<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);"
		    title="刷新">
			<i class="Hui-iconfont">&#xe68f;</i>
		</a>
	</nav>
	<div class="page-container">
		<div class="mt-20">
			<table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
				<thead>
					<tr class="text-c">
						<th width="">商户号</th>
						<th width="">登录名</th>
						<th width="">公司名</th>
						<th width="">身份证名</th>
						<th width="">序号</th>
						<th width="">用户总资产</th>
						<th width="">创建时间</th>
					</tr>
				</thead>
				<tbody class="j-specCard-box">
					<tr class="text-c">
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
					</tr>
				</tbody>
				<script type="text/x-jsrender" id="j-specCard">
					{{for data}}
					<tr class="text-c">
						<td>
							{{:userMerchantNo}}
						</td>
						<td>
							{{:account}}
						</td>
						<td>
							{{:userMerchantName}}
						</td>
						<td>
							{{:userName}}
						</td>
						<td>
							{{:userNo}}
						</td>
						<td>
							{{:merchantTotal}}元
						</td>
						<td>
							{{timeFilter:userTime}}
						</td>
					</tr>

					{{/for}}
				</script>
			</table>

			<!-- <div class="module-foot" style="padding:0px;text-align:center;">
				<div id="page" class="page_div"></div>
			</div> -->
		</div>
	</div>


</body>

</html>